cmake_minimum_required(VERSION 3.5)
project(agv_teleop)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(action_msgs REQUIRED)
find_package(agv_srvs REQUIRED)
find_package(shared_parameters REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)

include_directories(
  include
)

# Add executables
# add_executable(${PROJECT_NAME}_keyboard src/${PROJECT_NAME}_keyboard.cpp)
# ament_target_dependencies(${PROJECT_NAME}_keyboard
  # rclcpp
  # geometry_msgs
  # sensor_msgs
  # std_msgs
  # agv_srvs
# )

# add_executable(keyboard_publisher src/keyboard_publisher.cpp)
# ament_target_dependencies(keyboard_publisher
  # rclcpp
  # std_msgs
# )

# add_executable(${PROJECT_NAME} src/${PROJECT_NAME}.cpp)
# ament_target_dependencies(${PROJECT_NAME}
  # rclcpp
  # geometry_msgs
  # sensor_msgs
  # std_msgs
  # agv_srvs
# )

add_executable(${PROJECT_NAME}_HD1000 src/manual_handler.cpp)
ament_target_dependencies(${PROJECT_NAME}_HD1000
  rclcpp
  geometry_msgs
  sensor_msgs
  std_msgs
  agv_srvs
  shared_parameters
)

# Install targets
install(TARGETS 
  # ${PROJECT_NAME}_keyboard
  # keyboard_publisher
  # ${PROJECT_NAME}
  ${PROJECT_NAME}_HD1000
  DESTINATION lib/${PROJECT_NAME}
)

# Install launch files
install(DIRECTORY 
  launch/
  DESTINATION share/${PROJECT_NAME}/
)

# Install config files
install(DIRECTORY 
  config/
  DESTINATION share/${PROJECT_NAME}/
)

# Export dependencies
ament_export_dependencies(
  rclcpp
  geometry_msgs
  sensor_msgs
  std_msgs
  std_srvs
  action_msgs
  agv_srvs
)

ament_package()